<?php
    $ArMessage = SessionHelper::getMessage();
    $ClienteLogado = SessionHelper::getSession('ClienteLogado');
    $Javascript = SessionHelper::getJavascript();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <link rel="stylesheet" href="<?= BASEURL ?>views/css/defaultStylesheet.css">
        <script type="text/javascript" src="<?= BASEURL ?>views/js/jquery.js"></script>
        <?php foreach($Javascript as $Script): ?>
            <script type="text/javascript" src="<?= BASEURL . "views/js/$Script" ?>"></script>
        <?php endforeach; ?>
    </head>
    <body>
        <div class="error_welcome">
            <?php if(!empty($ClienteLogado)): ?>
                <span class="welcome">Bem-vindo(a) <a href="<?= BASEDIR ?>Cliente/MyAccount"><?= $ClienteLogado->getNome() ?></a>!
                    <a href="<?= BASEDIR ?>Cliente/LogOut">Log out</a>
                </span> 
            <?php else: ?>
                <span class="welcome">Bem-vindo(a)! <a href="<?= BASEDIR ?>Cliente/Login">Log in</a> para viajar.</span>
            <?php endif; ?>
            <?php if(!empty($ArMessage)): ?>
                <span class="<?= $ArMessage['type'] ?>"><?= $ArMessage['text'] ?></span>
            <?php endif; ?>
        </div>